package com.blogspot.security.domain;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.blogspot.security.enumtype.Status;

@Entity
@Table(name="APPLICATION_USER")
public class ApplicationUser implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
    /*系統產生ID*/
//    @Id
//    @GeneratedValue(strategy = GenerationType.AUTO)
//    @Column(name = "ID")
//    private Long id;
    /* 帳號 */
    @Id
    @Column(name = "USER_NAME")
    private String userName;
    /*密碼*/
    @Column(name = "PASSWORD")
    private String password;
    /*名字*/
    @Column(name = "NAME")
    private String name;
    /*連絡電話-家*/    
    @Column(name = "HOME_TEL")
    private String homeTel;
    /*連絡電話-手機*/
    @Column(name = "MOBILE_TEL")
    private String mobileTel;
    /*電子郵件*/
    @Column(name = "EMAIL")
    private String email;
    /*聯絡住址*/
    @Column(name = "ADDRESS")
    private String address;
    /*帳號狀態*/
    @Enumerated(EnumType.STRING)
    @Column(name = "STATUS", columnDefinition = "char")
    private Status status;
    /*帳號權限*/
    @ManyToOne(cascade = CascadeType.ALL)
    private ApplicationRole role;
    
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getHomeTel() {
		return homeTel;
	}
	public void setHomeTel(String homeTel) {
		this.homeTel = homeTel;
	}
	public String getMobileTel() {
		return mobileTel;
	}
	public void setMobileTel(String mobileTel) {
		this.mobileTel = mobileTel;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Status getStatus() {
		return status;
	}
	public void setStatus(Status status) {
		this.status = status;
	}
	public ApplicationRole getRole() {
		return role;
	}
	public void setRole(ApplicationRole role) {
		this.role = role;
	}
}
